// pages/qiyezoufangdetail/qiyezoufangdetail.js
const dayjs = require("dayjs");
import gcoord from "../../miniprogram_npm/gcoord/dist/gcoord";
import des from "../../utils/des";
let QR = require("../../utils/createQrCode.js"); // require方式

Page({
  /**
   * 页面的初始数据
   */
  data: {
    proInfo: {},
    islodding: false,
    form: {
      uploadPath: '',
      visitName: "",
      visitTime: "",
      contact: "",
      marketingStatus: "",
      visitContent: "",
      visitLocation: "",
    },
    longitude: '',
    latitude: '',
    zf_date_isshow: false,
    visitTime: new Date().getTime(),
    minDate: new Date(2022, 10, 1).getTime(),
    maxDate: new Date().getTime(),
    formatter(type, value) {
      if (type === 'year') {
        return `${value}年`;
      }
      if (type === 'month') {
        return `${value}月`;
      }
      if (type === 'day') {
        return `${value}日`;
      }
      console.log(value);
      return value;
    },
    zfdatefilter(type, options) {
      return options.reverse()
    },
    zfstateClickisshow: false,
    statecolumns: ["营销成功", "营销失败", "无需营销"],
    fileList: [],
    clockList: [], // 打卡记录
    allDkList: [], // 拜访记录
    statusBarHeight: '',
    navBarHeight: '',
    windowWidth: '',
    showSub: false,
    checkId: '',
    mdInfo: {},
    statusType: '',
    marketingStatusIndex: 0,
    corporateSurveyAnswerId: '', // 企业问卷答案
    qtTip: ''
  },
  createQrCode: function (content, canvasId, cavW, cavH) {
    //调用插件中的draw方法，绘制二维码图片
    //this.canvasToTempImage 为绘制完成的回调函数，可根据自己的业务添加
    QR.api.draw(content, canvasId, cavW, cavH, this, this.canvasToTempImage);
  },
  getCode() {
    const userInfo = wx.getStorageSync('userInfo')
    if (!this.data.corporateSurveyAnswerId) {
      // if (this.data.proInfo.qrcode == '1') {
      //   // 查看
      //   wx.navigateTo({
      //     url: `/sub_webview/visit/visit?corpName=${decodeURI(this.data.proInfo.corpName)}&shortName=${decodeURI(this.data.proInfo.shortName)}&corpCredit=${this.data.proInfo.corpCredit}&userId=${userInfo.userId}&type=1&rootName=interview&myId=${this.data.proInfo.id}`,
      //   })
      // } else {
      // console.log(this.data.proInfo, 'wode id')
      const qrCodeUrl = `https://fintech-zscqzy.szjrgzjg.com/#/cydnQt/qtA?phone=${userInfo.phone}&id=${this.data.proInfo.id}&viewType=${this.data.statusType}`
      // const qrCodeUrl = `https://fintech-zscqzy.szjrgzjg.com/#/cydnQt/qtA?phone=${userInfo.phone}&id=${this.data.proInfo.id}`
      console.log(qrCodeUrl, 'qrCodeUrlqrCodeUrlqrCodeUrl')
      this.createQrCode(qrCodeUrl, "mycanvas", this.data.windowWidth, this.data.windowWidth);
    } else {
      wx.navigateTo({
        url: `/sub_webview/qt/qt?type=2&phone=${userInfo.phone}&id=${this.data.proInfo.id}&viewType=${this.data.statusType}`,
      })
    }
  },
  //获取临时缓存图片路径，存入data中
  canvasToTempImage: function (canvasId = "mycanvas") {
    let that = this;
    wx.canvasToTempFilePath({
      canvasId, // 这里canvasId即之前创建的canvas-id
      success: function (res) {
        let tempFilePath = res.tempFilePath;
        // that.setData({
        //   qrcodeUrl: tempFilePath,
        // });
        wx.previewImage({
          current: tempFilePath, // 当前显示图片的http链接
          urls: [tempFilePath] // 需要预览的图片http链接列表
        })
      },
      fail: function (res) {},
    });
  },
  async goQuestion() {
    const userInfo = wx.getStorageSync('userInfo')
    // const qrCodeUrl = `https://fintech-zscqzy.szjrgzjg.com/#/cydnQt/qtA?phone=${userInfo.phone}&id=${this.data.proInfo.id}`
    const oneObj = this.data.allDkList.find(pre => pre.interviewSurveyAnswerId)
    const answerId = oneObj ? oneObj.interviewSurveyAnswerId : ''
    wx.navigateTo({
      url: `/sub_webview/qt/qt?type=1&id=${this.data.proInfo.id}&phone=${userInfo.phone}&answerId=${answerId}&viewType=${this.data.statusType}`,
    })
  },
  toClose() {
    this.setData({
      showSub: false
    })
  },
  openDetail() {
    wx.navigateTo({
      url: `/pages/mapDetail/mapDetail?corpKey=${this.data.proInfo.corpCredit}`,
    });
  },
  goSub() {
    let obj = {
      id: this.data.proInfo.id,
      opType: '记录',
      corpName: this.data.proInfo.corpName,
      corpCredit: this.data.proInfo.corpCredit,
      visitName: this.data.form.visitName,
      visitTime: this.data.form.visitTime,
      visitContent: this.data.form.visitContent,
      contact: this.data.form.contact,
      marketingStatus: this.data.form.marketingStatus,
      uploadPath: this.data.form.uploadPath
    }
    console.log(obj, '提交的参数');
    getApp().globalData.request_cydn("/marketing/marketingList/updateMarketingRecord", obj, "POST").then(res => {
      console.log(res, '提交的返回');
      setTimeout(function () {
        wx.hideLoading();
      }, 500);
      if (res.code == 200) {
        wx.showToast({
          title: '提交成功',
          icon: 'success'
        })
      } else {
        wx.showToast({
          title: res.msg,
        })
      }
    })
  },
  changeInput(e) {
    this.setData({
      [`form.${e.currentTarget.dataset.id}`]: e.detail.value
    })
  },
  onChangeAdd(e) {
    console.log(e.detail);
    this.setData({
      ['form.addressIsSyn']: e.detail
    })
  },
  editZfCase(e) {
    this.setData({
      ['form.zf_case']: e.detail.value
    })
  },
  zfdateclick() {
    this.setData({
      zf_date_isshow: true
    })
  },
  onInput(e) {
    console.log(e);
  },
  location(e) {
    const longitude = this.transMarker1([
      this.data.proInfo.longitude,
      this.data.proInfo.latitude,
    ])[0];
    const latitude = this.transMarker1([
      this.data.proInfo.longitude,
      this.data.proInfo.latitude,
    ])[1];
    wx.openLocation({
      latitude: latitude,
      longitude: longitude,
      scale: 18,
    });
  },
  zfdateConfirm(e) {
    console.log(dayjs(new Date(e.detail)).format("YYYY-MM-DD"));
    this.setData({
      ['form.visitTime']: dayjs(new Date(e.detail)).format("YYYY-MM-DD"),
      zf_date_isshow: false
    })
  },
  zfdateCancel() {
    this.setData({
      zf_date_isshow: false
    })
  },

  zfstateClick() {
    this.setData({
      zfstateClickisshow: true
    })
  },
  // 中心点坐标转化
  transMarker1(item) {
    const resae = gcoord.transform(
      [item[0], item[1]],
      gcoord.BD09, // 当前坐标系
      gcoord.GCJ02 // 目标坐标系
    );
    return resae;
  },
  zfstateConfirm(e) {
    console.log(e.detail.value);
    this.setData({
      ['form.marketingStatus']: e.detail.value,
      zfstateClickisshow: false
    })
  },
  zfstateCancel() {
    this.setData({
      zfstateClickisshow: false
    })
  },
  afterRead(event) {
    console.log(event);
    const {
      file
    } = event.detail;
    console.log(file);
    this.data.fileList.push({
      ...file,
      url: file.url,
      deletable: true,
    })
    this.setData({
      fileList: this.data.fileList
    })

  },
  deleteImg() {
    this.data.fileList.pop()
    this.setData({
      fileList: this.data.fileList,
    })
    getApp().globalData.request("/api/fileApi/cosDelete", {
      url: this.data.form.uploadPath
    }, "POST").then(res => {
      console.log(res);
      if (res.code == 200) {
        this.setData({
          ["form.uploadPath"]: ""
        })
        wx.showToast({
          title: res.data,
        })
      } else {
        wx.showToast({
          title: res.data,
        })
      }
    })
  },
  selectImg() {
    var that = this
    wx.chooseMedia({
      count: 9,
      mediaType: ['image', 'video'],
      sourceType: ['album', 'camera'],
      maxDuration: 30,
      camera: 'back',
      sizeType: ['original', 'compressed'],
      success(res) {
        console.log(res);
        const tempFilePaths = res.tempFiles
        that.data.fileList.push({
          ...tempFilePaths[0],
          url: tempFilePaths[0].tempFilePath,
          deletable: true,
        })
        that.setData({
          fileList: that.data.fileList,
          islodding: true
        })
        // 上传文件 
        wx.showLoading({
          title: '上传中',
        })
        wx.uploadFile({
          url: 'https://fintech-wx.szjrgzjg.com/api/fileApi/cosUpload',
          filePath: tempFilePaths[0].tempFilePath,
          name: 'file',
          formData: {
            file: tempFilePaths[0],
            folder: "cydn_yxmd"
          },
          header: {
            token: wx.getStorageSync("token")
          },
          success(res) {
            var data = des.decrypt(
              JSON.parse(res.data).data,
              "98fbffd1064a4355b8abaacb6fa96f94"
            );
            console.log(JSON.parse(data));
            wx.hideLoading()
            that.setData({
              ["form.uploadPath"]: JSON.parse(data).data,
              islodding: false
            })
          },
          fail(err) {
            console.log(err);
          }
        })
      }
    })
  },
  async verifyRules() {
    let verFy = true
    if (!this.data.form.visitName) {
      wx.showToast({
        title: '请填写客户姓名',
        icon: 'none'
      })
      verFy = false
    }
    if (!this.data.form.contact) {
      wx.showToast({
        title: '请填写联系方式',
        icon: 'none'
      })
      verFy = false
    }
    if (!this.data.form.visitTime) {
      wx.showToast({
        title: '请选择拜访时间',
        icon: 'none'
      })
      verFy = false
    }
    if (!this.data.form.visitContent) {
      wx.showToast({
        title: '请填写拜访记录',
        icon: 'none'
      })
      verFy = false
    }
    if (this.data.form.marketingStatus == '营销成功') {
      // 校验问卷
      const params = {
        id: this.data.checkId
      }
      const newRes = await getApp().globalData.request_cydn("/marketing/marketingCorp/getOneMarketCorpDetail", params, "POST")
      if (newRes.data.interviewSurveyId) {
        // 客户经理问卷
        if (!newRes.data.interviewSurveyAnswerId) {
          wx.showToast({
            title: '请填写客户经理问卷',
            icon: 'none'
          })
          verFy = false
        }
      }
      if (newRes.data.corporateSurveyId) {
        // 企业问卷
        if (!newRes.data.corporateSurveyAnswerId) {
          wx.showToast({
            title: '请填写企业问卷',
            icon: 'none'
          })
          verFy = false
        }
      }
    }
    return verFy
  },

  async commitBasicInfo() {
    // console.log(this.data.form, 'form');
    const vRes = await this.verifyRules()
    if (vRes) {
      // wx.showLoading({
      //   title: '正在提交...',
      // })
      let obj = {
        id: this.data.proInfo.id,
        opType: '记录',
        corpName: this.data.proInfo.corpName,
        corpCredit: this.data.proInfo.corpCredit,
        visitName: this.data.form.visitName,
        visitTime: this.data.form.visitTime,
        visitContent: this.data.form.visitContent,
        contact: this.data.form.contact,
        marketingStatus: this.data.form.marketingStatus,
        uploadPath: this.data.form.uploadPath
      }
      console.log(obj, '提交的参数');
      getApp().globalData.request_cydn("/marketing/marketingList/updateMarketingRecord", obj, "POST").then(res => {
        console.log(res, '提交的返回');
        setTimeout(function () {
          wx.hideLoading();
        }, 500);
        if (res.code == 200) {
          wx.showToast({
            title: '提交成功',
            icon: 'success'
          })
        } else {
          wx.showToast({
            title: res.msg,
          })
        }
      })
    }
  },

  goPoint() {
    if (this.data.form.visitLocation) {
      const params = {
        id: this.data.proInfo.id,
        opType: '记录',
        corpName: this.data.proInfo.corpName,
        corpCredit: this.data.proInfo.corpCredit,
        visitLocation: this.data.form.visitLocation,
        followLatitude: this.data.form.latitude,
        followLongitude: this.data.form.longitude,
      }
      console.log(params, 'params');
      getApp().globalData.request_cydn("/marketing/marketingList/updateMarketingRecord", params, "POST").then(res => {
        // console.log(res, '提交的返回');
        if (res.code == 200) {
          wx.showToast({
            title: '打卡成功',
            icon: 'success'
          })
          // 更新记录列表
          this.getAllInfo()
        } else {
          wx.showToast({
            title: res.msg,
          })
        }
      })
    } else {
      wx.showToast({
        title: '请开启定位功能',
        icon: 'none'
      })
    }
  },
  goback() {
    wx.navigateBack({
      delta: 1
    })
  },
  async getRecordList() {
    const params = {
      recordId: this.data.checkId
    }
    const res = await getApp().globalData.request_cydn("/marketing/marketingList/getMarketingFollowRecordList", params, "POST")
    console.log(res, '打卡记录');
    if (res.code == 200) {
      // 数据回显最近的一次数据
      if (this.data.allDkList.length === 0) {
        const one = res.rows.find(pre => pre.visitName)
        if (one) {
          this.setData({
            ['form.visitName']: one.visitName,
            ['form.contact']: one.contact,
            ['form.visitTime']: one.visitTime,
            ['form.visitContent']: one.visitContent,
            ['form.marketingStatus']: one.clueStatus,
            ['form.uploadPath']: one.uploadPath,
            // ['form.contact']: one.contact,
            visitTime: one.visitTime ? new Date(one.visitTime).getTime() : new Date().getTime(),
            marketingStatusIndex: one.clueStatus ? this.data.statecolumns.findIndex(val => val === one.clueStatus) : 0,
            fileList: one.uploadPath ? [{
              url: one.uploadPath,
              deletable: true,
            }] : []
          })
        }
      }
      this.setData({
        allDkList: res.rows,
        clockList: res.rows.filter(pre => pre.visitLocation)
      })
    }
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    const that = this
    //获取系统信息， 状态栏高度为 sysInfo['statusBarHeight'];
    let sysInfo = wx.getSystemInfoSync();
    // 胶囊信息
    let menu = wx.getMenuButtonBoundingClientRect();
    // 导航栏高度
    let navBarHeight = (menu.top - sysInfo.statusBarHeight) * 2 + menu.height;
    console.log(sysInfo.statusBarHeight + navBarHeight);
    this.setData(({
      statusBarHeight: sysInfo.statusBarHeight,
      navBarHeight: navBarHeight,
      windowWidth: sysInfo.windowWidth
    }))
    this.setData({
      checkId: options.id,
      mdInfo: wx.getStorageSync('md_top_obj')
    })
    this.getAllInfo()
    // 获取当前的位置信息
    getApp().globalData.getLocation({
      type: "gcj02",
      success(res) {
        // 获取当前的定位
        that.getLocationNow(res);
      },
    });
    // let userID = wx.getStorageSync("userInfo").userId
    // console.log({
    //   userId: userID,
    //   corpCredit: options.corpCredit
    // }, 'params')
    // getApp().globalData.request("/visit/getVisitCorpInfo", {
    //   userId: this.data.userId ? this.data.userId : userID,
    //   corpCredit: options.corpCredit
    // }, "POST").then(res => {
    //   console.log(res, '返回的结果');
    //   if (res.data.visitPictureUrl) {
    //     this.data.fileList.push({
    //       url: res.data.visitPictureUrl,
    //       deletable: true,
    //     })
    //   } else {
    //     this.data.fileList = []
    //   }
    //   // 处理颜色和背景
    //   let keyList = []
    //   const keyValues = config.visit_suzhou
    //   res.data.statusList.forEach(poi => {
    //     const oneObj = keyValues.find(pr => pr.text === poi)
    //     keyList.push(oneObj)
    //     res.data.keyList = keyList
    //   })
    //   this.setData({
    //     proInfo: res.data,
    //     labelList: res.data.keyList,
    //     ["form.zf_name"]: res.data.contactPerson,
    //     ["form.zf_phone"]: res.data.contactPhone,
    //     ["form.zf_date"]: res.data.visitDate || dayjs(new Date(new Date().getTime())).format("YYYY-MM-DD"),
    //     ["form.zf_date_in"]: new Date(res.data.visitDate).getTime() || new Date().getTime(),
    //     ["form.zf_case"]: res.data.visitRemark,
    //     ["form.zf_state"]: res.data.visitStatus,
    //     ["form.zf_img"]: res.data.visitPictureUrl,
    //     ["form.addressIsSyn"]: res.data.addressIsSyn || '是',
    //     ["form.isSynComment"]: res.data.isSynComment,
    //     ["form.zf_zhiwu"]: res.data.position,
    //     fileList: this.data.fileList,
    //     clockList: res.data.clockList
    //   })
    // })
  },
  async getAllInfo() {
    if (!this.data.checkId) return
    // 获取打卡记录
    this.getRecordList()
    const params = {
      id: this.data.checkId
    }
    const res = await getApp().globalData.request_cydn("/marketing/marketingCorp/getOneMarketCorpDetail", params, "POST")
    console.log(res, 'getOneMarketCorpDetail');
    res.data.statusStyle = this.clueStatusColor(res.data.clueStatus)
    this.setData({
      proInfo: res.data,
      corporateSurveyAnswerId: res.data.corporateSurveyAnswerId
    })
    // 权限判断
    this.dealQuanXian()
  },
  dealQuanXian() {
    const userInfo = wx.getStorageSync('userInfo')
    const element = this.data.proInfo
    let outManoulate = ['触达'];
    if (userInfo.corpRole.includes("fir_admin")) {
      //如果是子机构名单只有触达权限
      if (this.data.mdInfo.upDownType !== "子机构名单") {
        if (element.clueStatus === "未分配") {
          //
          if (this.data.mdInfo.listTypeName !== "个人名单") {
            outManoulate.push("分配");
          }
          //如果已经分配到机构，不需要跟进
          if (!element.clueDeptId) {
            outManoulate.push("跟进");
          }
          if (element.createUser === userInfo.userId) {
            outManoulate.push("删除");
          }
        } else if (element.clueStatus === "待跟进") {
          if (this.data.mdInfo.listTypeName === "个人名单") {
            outManoulate.push(...["记录", "营销成功", "营销失败"]);
          }
          if (this.data.mdInfo.listTypeName !== "个人名单") {
            outManoulate.push("转介");
          }
          outManoulate.push("退回");
          outManoulate.push("无需营销");
        } else if (element.clueStatus === "跟进中") {
          if (this.data.mdInfo.upDownType === "自己添加") {
            if (element.clueUserId === userInfo.userId) {
              if (this.data.mdInfo.listTypeName !== "个人名单") {
                outManoulate.push("转介");
              }
              outManoulate.push(
                ...["记录", "退回", "无需营销", "营销成功", "营销失败"]
              );
            } else {
              outManoulate.push(...["退回", "转介", "无需营销"]);
            }
          } else {
            if (element.clueUserId === userInfo.userId) {
              outManoulate.push(
                ...["记录", "无需营销", "营销成功", "营销失败"]
              );
            } else {
              outManoulate.push(...["退回", "转介", "无需营销"]);
            }
          }
        } else if (element.clueStatus === "营销成功") {
          outManoulate.push("关注");
        } else if (element.clueStatus === "营销失败") {} else if (element.clueStatus === "无需营销") {}
      }
    } else if (userInfo.corpRole.includes("sec_admin")) {
      if (this.data.mdInfo.upDownType !== "子机构名单") {
        if (element.clueStatus === "未分配") {
          if (element.createUser === userInfo.userId) {
            outManoulate.push("删除");
          }
          //自己创建才有跟进，上级分配到机构不需跟进
          if (this.data.mdInfo.upDownType === "自己添加") {
            //if(!element.clueDeptId)  {
            outManoulate.push("跟进");
            //}
          }
          outManoulate.push("分配");
          if (element.createUser !== userInfo.userId) {
            outManoulate.push("认领");
          }
        } else if (element.clueStatus === "待跟进") {
          if (this.data.mdInfo.listTypeName === "个人名单") {
            outManoulate.push(...["记录", "营销成功", "营销失败"]);
          }
          if (element.clueUserId === userInfo.userId) {
            if (this.data.mdInfo.listTypeName !== "个人名单") {
              outManoulate.push("分配");
            }
            outManoulate.push("跟进");
          } else {
            outManoulate.push("退回");
            outManoulate.push("转介");
          }
          outManoulate.push("无需营销");
        } else if (element.clueStatus === "跟进中") {
          if (this.data.mdInfo.upDownType === "自己添加") {
            if (element.clueUserId === userInfo.userId) {
              if (this.data.mdInfo.listTypeName !== "个人名单") {
                outManoulate.push("转介");
              }
              outManoulate.push(
                ...["记录", "退回", "无需营销", "营销成功", "营销失败"]
              );
            } else {
              outManoulate.push(...["退回", "转介", "无需营销"]);
            }
          } else {
            if (element.clueUserId === userInfo.userId) {
              outManoulate.push(
                ...["记录", "无需营销", "营销成功", "营销失败"]
              );
            } else {
              outManoulate.push(...["退回", "转介", "无需营销"]);
            }
          }
        } else if (element.clueStatus === "营销成功") {
          outManoulate.push("关注");
        } else if (element.clueStatus === "营销失败") {} else if (element.clueStatus === "无需营销") {}
      }
    } else if (userInfo.corpRole.includes("manager")) {
      if (this.data.mdInfo.upDownType !== "子机构名单") {
        if (element.clueStatus === "未分配") {
          if (element.createUser !== userInfo.userId) {
            outManoulate.push("认领");
          }
          if (element.createUser === userInfo.userId) {
            outManoulate.push("删除");
          }
        } else if (element.clueStatus === "待跟进") {
          outManoulate.push(...["跟进", "无需营销"]);
        } else if (element.clueStatus === "跟进中") {
          outManoulate.push(
            ...["记录", "营销成功", "营销失败", "无需营销"]
          );
        } else if (element.clueStatus === "营销成功") {
          outManoulate.push("关注");
        } else if (element.clueStatus === "营销失败") {} else if (element.clueStatus === "无需营销") {}
      }
    }
    // console.log(outManoulate, 'outManoulate');
    if (outManoulate.includes('记录')) {
      this.setData({
        statusType: '1'
      })
    }
  },
  getLocationNow(info) {
    this.setData({
      ['form.longitude']: this.transMarker([info.longitude, info.latitude])[0],
      ['form.latitude']: this.transMarker([info.longitude, info.latitude])[1],
    })
    getApp()
      .globalData.request(
        "/map/inverseGeocode", {
          lat: this.data.form.latitude,
          lng: this.data.form.longitude,
        },
        "POST"
      )
      .then((res) => {
        console.log(res, '定位信息');
        const rstObj = res;
        if (rstObj.data) {
          this.setData({
            ['form.visitLocation']: rstObj.data.replace("苏州市苏州", "苏州市"),
          });
        } else {
          this.setData({
            position: '获取定位失败',
          });
        }
      });
  },
  clueStatusColor(clueStatus) {
    const mapColor = [{
        status: "未分配",
        bgcolor: "#FAEBE6",
        color: "#F05728",
      },
      {
        status: "营销成功",
        bgcolor: "#E3F2ED",
        color: "#3F9F71",
      },
      {
        status: "无需营销",
        bgcolor: "#E9E9E9",
        color: "#6B6B6B",
      },
      {
        status: "跟进中",
        bgcolor: "#E4EFFF",
        color: "#3282E4",
      },
      {
        status: "待跟进",
        bgcolor: "#EEE8F9",
        color: "#7B58C2",
      },
      {
        status: "营销失败",
        bgcolor: "#F6E6E1",
        color: "#C33D28",
      },
    ];
    return mapColor.find((item) => item.status === clueStatus);
  },
  // 坐标系转化
  transMarker(item) {
    const resae = gcoord.transform(
      [item[0], item[1]],
      gcoord.GCJ02, // 当前坐标系
      gcoord.BD09 // 目标坐标系
    );
    return resae;
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    if (this.data.proInfo && this.data.proInfo.id) {
      this.getAllInfo()
    }
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})